<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<div id="roleAddDialog-form" title="增加角色">
	<form id="addForm" action="${pageContext.request.contextPath }/pages/role_add.do" method="post">
		<fieldset>
			<label class="f_label" for="name">
				角色名称：
			</label>
			<input type="text" name="role.name" class="text" />
			<br>
			<label class="f_label" for="description">
				角色描述：
			</label>
			<input type="text" name="role.description" class="text" />
			<label class="f_label" for="res">
				拥有资源：
			</label>
			<input type="hidden" name="ResIds" id="ResIds" />
			<div id="r">
			</div>
		</fieldset>
	</form>
	<script type="text/javascript">
		function addFormCollecter() {
			var Objs = $("input[name='res_id']:checked"); 
			var Res_ids = "";
			for(var i = 0; i < Objs.length; i ++) {
				if(Res_ids != "") {   
       				Res_ids += ",";   
      			}   
      			Res_ids += Objs[i].value;  
			}
			if(Res_ids != "" ) {
				$("#ResIds").val(Res_ids);
			} 
			$("#addForm").submit(); 
			return false;
		}
	</script>
</div>
